<!--
 * @Description: 
 * @Author: charles
 * @Date: 2021-05-05 22:02:56
 * @LastEditors: cwh
 * @LastEditTime: 2022-01-08 18:01:48
-->
<template>
  <div ref="right2_container" id="container" style="height: 95%"></div>
</template>
<script>
import { Gauge } from '@antv/g2plot';


export default {

  mounted() {
    this.initChart();
  },
  methods:{
    
  initChart(){
    const gauge = new Gauge(this.$refs.right2_container, {
  percent: 0.4,
  range: {
    color: '#30BF78',
  },
  indicator: {
    pointer: {
      style: {
        stroke: '#D0D0D0',
      },
    },
    pin: {
      style: {
        stroke: '#D0D0D0',
      },
    },
  },
  axis: {
    label: {
      formatter(v) {
        return Number(v) * 100;
      },
    },
    subTickLine: {
      count: 3,
    },
  },
  statistic: {
    content: {
      formatter: ({ percent }) => `Rate: ${(percent * 100).toFixed(0)}%`,
      style: {
        color: 'rgba(0,0,0,0.65)',
        fontSize: 48,
      },
    }}
    
});

gauge.render();
    }
  }
}
</script>